package com.yst.web.common;

import lombok.Getter;

/**
 * declare exception for business
 */
@Getter
public final class BusinessException extends RuntimeException {

    private final int code;

    public BusinessException(ResultCode code){
        super(code.description);
        this.code=code.code;
    }

    public BusinessException(ResultCode code,String message){
        super(message);
        this.code=code.code;
    }

    public BusinessException(int code,String message){
        super(message);
        this.code=code;
    }

    public BusinessException(String message) {
        super(message);
        code=ResultCode.ERROR_BUSINESS.code;
    }
}
